package com.lanchetech.admin.controller;

import com.lanchetech.admin.service.TeacherService;
import com.lanchetech.bean.request.IdentityReq;
import com.lanchetech.bean.request.PageReq;
import com.lanchetech.bean.request.TeacherGroupReq;
import com.lanchetech.bean.response.BasePageResp;
import com.lanchetech.bean.response.BaseResp;
import com.lanchetech.bean.response.ResultData;
import com.lanchetech.bean.vo.IdentityVO;
import com.lanchetech.bean.vo.TeacherGroupVO;
import com.lanchetech.bean.vo.TeacherVO;
import com.lanchetech.entity.Shop;
import com.lanchetech.entity.TeacherGroup;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(value = "讲师管理", tags = "讲师管理")
@RequestMapping("/api/teacher")
@RestController
public class TeacherController {

    @Autowired
    TeacherService teacherService;

    @ApiOperation("添加讲师")
    @GetMapping("/addTeacher")
    public BaseResp addTeacher(@RequestParam("phone") String phone,@RequestParam("teacherLevel") Byte teacherLevel) {
        return teacherService.addTeacher(phone,teacherLevel);
    }

    @ApiOperation("删除讲师身份")
    @GetMapping("/removeTeacher")
    public BaseResp removeTeacher(@RequestParam("id") Long id) {
        return teacherService.removeTeacher(id);
    }


    @ApiOperation("获取讲师列表")
    @PostMapping("/getTeacherPage")
    public ResultData<BasePageResp<IdentityVO>> getTeacherPage(@RequestBody IdentityReq req) {
        return teacherService.getTeacherPage(req);
    }

    @ApiOperation("获取讲师团队列表")
    @PostMapping("/getTeacherGroupPage")
    public ResultData<BasePageResp<TeacherGroupVO>> getTeacherGroupPage(@RequestBody TeacherGroupReq req) {
        return teacherService.getTeacherGroupPage(req);
    }

}
